#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

export MONO_SHARED_DIR := /tmp

post-patches:: debian/stamp-build
debian/stamp-build:
	(cd FlickrNet; $(SHELL) ../debian/compile.sh)
	touch $@

clean::
	$(RM) FlickrNet/FlickrNet.dll FlickrNet/FlickrNet.dll.mdb debian/stamp-build

VERSION=2.1.5
install/libflickrnet$(VERSION)-cil::
	dh_install FlickrNet/FlickrNet.dll /usr/lib/cli/flickrnet-$(VERSION)/
	install -m644 -D debian/flickrnet.pc $(DEB_DESTDIR)/usr/lib/pkgconfig/flickrnet-$(VERSION).pc
	sed -i "s/@VERSION@/$(VERSION)/g" $(DEB_DESTDIR)/usr/lib/pkgconfig/flickrnet-$(VERSION).pc
	dh_link /usr/lib/pkgconfig/flickrnet-$(VERSION).pc /usr/lib/pkgconfig/flickrnet.pc

binary-install/libflickrnet$(VERSION)-cil::
	dh_installcligac -plibflickrnet$(VERSION)-cil
	dh_cligacpolicy
	dh_clifixperms

binary-predeb/libflickrnet$(VERSION)-cil::
	dh_makeclilibs -plibflickrnet$(VERSION)-cil
	dh_clideps -d

get-orig-source:
	sh debian/orig-tar.sh $(DEB_UPSTREAM_VERSION)
